<script>
export default {
  onLaunch: function () {
    const version = 4;
    const currentVersion = uni.getStorageSync("version");
    console.log(`当前版本: ${currentVersion}`);
    console.log(`最新版本: ${version}`);
    if (currentVersion !== version) {
      uni.clearStorageSync();
      uni.setStorageSync("version", version);
      console.log("版本升级，已清空缓存");
    }
    uni.getStorageSync("history") || uni.setStorageSync("history", []);
    uni.getStorageSync("target") ||
      uni.setStorageSync("target", {
        targetWeight: "",
        unit: "",
        bodyHeight: "",
        sex: "",
        birth: "",
      });
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss";
@import "@/static/style/l-css.scss";
@import "@/static/style/l-space.scss";

page {
  background: #ffffff;
}
.uni-picker-item {
  font-size: $uni-font-size-lg !important;
}
.btn-large {
  font-size: $uni-font-size-lg;
  background: $uni-color-primary;
  color: #ffffff;
  border-radius: 100rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100rpx;
  width: 500rpx;
  align-self: center;
}
</style>
